home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / web / fweb / fweb-1.40 / manual / demo1.web < prev    next >
Text File  |  1993-10-29  |  1KB  |  51 lines

  1. @z --- demo1.web ---
  2.  
  3. This file is part of FWEB.  It and its woven output demo1.tex is included
  4. into the user manual fwebman.tex. 
  5.  
  6. Author:  J. A. Krommes
  7. Version: 1.23
  8. Date:    April 1, 1992
  9.  
  10. @x-----------------------------------------------------------------------------
  11.  
  12. \def\WEB{\.{WEB}} % A TeX macro definition in limbo.
  13.  
  14. @n/ @% The slash tells Fortran to recognize '//' as the start of a short
  15.     @% comment rather than the conventional concatenation symbol.
  16. @* DEMO. This example demonstrates the use of named modules, and some other
  17. features of~\WEB.
  18.  
  19. @#ifndef N
  20.     @m N 100 /* If you define this macro from the command line by
  21.             saying ``\.{-mN=200}'', that definition will
  22.             override this one. */ 
  23. @#endif
  24.  
  25. @a
  26.     program main 
  27.     @<Common declarations@> 
  28.     @<Read data@>
  29.     @<Process data@>
  30.     @<Graph results@>
  31.     end
  32.  
  33. @ Accreting and inserting |common| declarations is an interesting use of
  34. named modules.
  35.  
  36. @f @<Com...@> common
  37.  
  38. @<Com...@>=
  39.     real a(N)
  40.     common a
  41.  
  42. @ Possibly after many more modules that aren't shown here, we get to code
  43. related to graphics. Here we accrete more information into the common
  44. declarations. The discretized abscissa data is held in the array~|xx|; the
  45. ordinate is in~|yy|.
  46. @<Com...@>=
  47.     real xx(N), yy(n) // Example: |call curve(xx,yy,N,1)|
  48.     common/graphs/ xx,yy
  49.  
  50. @* INDEX.
  51.